export const block: ICustomBlockOption = {
    name: "SToyKaleidoscope2",
    comments: "实现ShaderToy万花筒效果2",
    document: "https://www.shadertoy.com/view/fstGDN",
    target: "Neutral",
    inParameters: [
        {
            name: "uv",
            type: "Vector2"
        },
        {
            name: "time",
            type: "Float"
        }
    ],
    outParameters: [
        {
            name: "output",
            type: "Vector4"
        }
    ],
    "includes": [
        "shaderToyDeclaration"
    ],
    entryFunctionName: "SToyKaleidoscope2",
    code: `
        void SToyKaleidoscope2(vec2 fragCoord, float t, out vec4 result) {
            vec2 r = iResolution;
            vec3 c;
            float l,z=t;
            for(int i=0;i<3;i++) {
                vec2 uvTemp,p=fragCoord.xy/r;
                uvTemp=p;
                p-=.5;
                p.x*=r.x/r.y;
                z+=.07;
                l=length(p);
                uvTemp+=p/l*(tan(z)+1.)*abs(tan(l*9.-z*2.));
                c[i]=.01/length(mod(uvTemp,1.)-.5);
            }
            result=vec4(c/l,t);
        }
    `
}